<?php
class OORDBMySQLGenericObject implements IteratorAggregate 
{
	private $values;
	
	public function __construct( array $values )
	{
		$this->values = $values;
	}
	
	public function set( $name, $value )
	{
		if ( isset( $this->values[$name] ) )
		{
			$this->values[$name] = $value;
		}
		else
		{
			throw new Exception( "Attribute $name does not exist" );
		}
	}
	
	public function get( $name )
	{
		if ( isset( $this->values[$name] ) )
		{
			return $this->values[$name];
		}
		else
		{
			throw new Exception( "Attribute $name does not exist" );
		}
	}
	
	public function getIterator()
	{
		return new ArrayIterator( $this->values );
	}
}
?>